package com.lzy.service.impl;

import com.lzy.gmail.bean.UserAdress;
import com.lzy.gmail.service.UserService;
import org.springframework.util.StringUtils;

import java.util.List;

public class UserServiceImpl implements UserService {

	private final UserService userService;

	/**
	 * 传入的是UserService的远程代理对象
	 * @param userService
	 */
	public UserServiceImpl(UserService userService) {
		this.userService = userService;
	}

	/**
	 * 本地存根，进行空字符进行判断
	 * @param userId
	 * @return
	 */
	@Override
	public List<UserAdress> getUserAddressList(String userId) {
		System.out.println("UserServiceImpl stub");
		// 判断是否为空
		if(StringUtils.hasLength(userId)) {
			System.out.println("--");
			return userService.getUserAddressList(userId);
		}
		return null;
	}
}
